﻿using System;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using BDElectron.Remote;

namespace BDElectron.ClientPanels
{
    public partial class MaintainUsersPanel : UserControl
    {
        IServerObject mServerObject = null;

        public MaintainUsersPanel(IServerObject ServerObject)
        {
            InitializeComponent();
            mServerObject = ServerObject;
        }

        private void CloseThisTab()
        {
            TabPage tabpage = (TabPage)this.Parent;
            TabControl tabControl = (TabControl)tabpage.Parent;
            tabControl.TabPages.Remove(tabpage);
        }

        private void closeButton_Click(object sender, EventArgs e)
        {
            CloseThisTab();
        }

        private void FillUserListGridView()        
        {
            DataTable userlist = mServerObject.GetUsersList();
            userListGridView.DataSource = userlist;
        }

        private void MaintainUsersPanel_Load(object sender, EventArgs e)
        {
            FillUserListGridView();
        }


    }
}
